
  <template>
	<view>
		<ccNoticeBar style="margin-bottom:10upx;" v-if="noticeList.length>0" :noticeList="noticeList" colors="olive"
			@click="itemClick"></ccNoticeBar>
		<view class="cu-modal" :class="modalName=='notice'?'show':''" v-if="notice!=null">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">{{notice.title}}</view>
					<view class="action" @click="modalName=''">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<view class="padding-left-lg padding-right-lg bg-white" style="max-height: 500upx;overflow-y: scroll;">
					<u-parse className="padding-tb-sm" :content="notice.content"></u-parse>
				</view>
				<view class="cu-bar bg-white justify-end">
					<view class="action">
						<button class="cu-btn line-theme text-theme" @click="modalName=''">已 阅</button>
		
					</view>
				</view>
			</view>
		</view>
		
	</view>

</template>

<script>
	import ccNoticeBar from "@/components/cc-noticeBar/cc-noticeBar"
	import store from "@/store";
	import {
		mapGetters
	} from "vuex";
	export default {
		components: {
			"ccNoticeBar": ccNoticeBar,
		},
		computed: {
			...mapGetters([
				'token', 'RoleTypeFormat', "userInfo", "userId"
			])
		},
		data() {
			return {
				noticeList: [],
				notice: null,
				modalName: "notice",
			};
		},
		mounted() {
			this.NoticeListApi();
		},
		methods: {
			itemClick: function(item) {
				this.modalName = "notice";
				this.notice = item;	
			},
			/**
			 * 系统公告查询
			 */
			async NoticeListApi() {
				let {
					Data: {
						Items
					}
				} = await this.$http.PostAsync("/SysNotice/List", {
			
				});
				this.noticeList = Items.map(x => {
					return {
						id: x.Id,
						title: x.Name,
						content: x.Content
					};
				});
			},
			
		}
	}
</script>

<style lang="scss">

</style>
